The enclosed stack and XCMD resources demonstrate how to use the Word Services Apple Event Suite from your HyperCard stacks. To try it out, install Spellswell 7, Spellswell Plus, or the Spellswell Plus Demo (from http://www.working.com), then open the Word Services stack and press the Spellcheck button.
Word Services allows any application that uses text to link to a speller, grammar checker or other text service as if it is a built-in menu item. Word Services is a public protocol - no license fee or nondisclosure is required to use it.
AppleScript must be installed to allow HyperCard to use Word Services. Normally, Word Services does not use AppleScript at all, but HyperCard requires it.
There is a subtle bug in HyperCard which prevented Word Services from working. We have worked around the bug in recent versions of Spellswell 7 and Spellswell Plus. You will need version 2.0.2 or later. Earlier Spellswell versions will be able to retrieve text from the stack but will not be able to replace the erroneous words with corrections. If you have Spellswell 7 or Spellswell Plus 2.0.x, you can get a free updater from http://www.webcom.com/~working/upgrades.html.
The DoBatchCheck XCMD takes the speller's creator code as a parameter plus optional parameters for which card and field to check. Another XCMD needs to be written to allow the user to choose a service, rather than hardwiring the Spellswell creator code into the button script. The speller is launched if it is not already running.
To use the XCMD in your own stack, use ResEdit to copy the XCMD resource from the Word Services Stack into your stack. Then use the Button tool to open up the script of the Spellcheck button. Copy the script into a button in your own stack.
Complete documentation and free source code to Writeswell Jr., a simple Word Services word processor, and WSI Newswatcher, a usenet news reader which allows you to spellcheck your posts, are available on the Word Services home page at:
http://www.wordservices.org/
Please also visit the Working Software home page at:
http://www.working.com/
Michael D. Crawford
crawford@scruznet.com
http://www.scruznet.com/~crawford/
Version History
• 1.0d3 Added ability to launch speller from disk by searching desktop file. Included whizzy GoToWebPage XCMD as a bonus.
• 1.0d2 Added optional fieldNumber and cardNumber parameters.